package controllers;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.AjaxBehaviorEvent;

import modelo.Cobro;
import modelo.Concepto;
import modelo.Modopago;

import org.primefaces.event.RowEditEvent;
import org.primefaces.event.TransferEvent;
import org.primefaces.model.DualListModel;

import services.CobroService;
import services.ConceptoService;
import services.ModoPagoService;

@ManagedBean(name = "cobroBean")
@ViewScoped
public class CobroBean implements Serializable {

	private static final long serialVersionUID = 1063491413375623573L;

	@ManagedProperty("#{conceptoService}")
	private ConceptoService serviceConcepto;
	private List<Concepto> listConcepto = new ArrayList<Concepto>();
	private Concepto conceptoSelected = new Concepto();

	@ManagedProperty("#{modoPagoService}")
	private ModoPagoService serviceModoPago;
	private List<Modopago> listModoPago = new ArrayList<Modopago>();
	private Modopago modoPagoSelected = new Modopago();

	@ManagedProperty("#{cobroService}")
	private CobroService serviceCobro;
	private Cobro cobro = new Cobro();

	public CobroBean() {
		super();
	}

	@PostConstruct
	private void init() {

		listConcepto = serviceConcepto.getListaConceptos();
		listModoPago = serviceModoPago.getListaModosPagos();
	}

	public void guardarCobro() {

		// serviceSalon.guardarSalon(salon, domicilio, tiposEventos.getTarget(),
		// listCaracteristicasSeleccionadas, listTelefonoSalon);
	}

	public ConceptoService getServiceConcepto() {
		return serviceConcepto;
	}

	public void setServiceConcepto(ConceptoService serviceConcepto) {
		this.serviceConcepto = serviceConcepto;
	}

	public List<Concepto> getListConcepto() {
		return listConcepto;
	}

	public void setListConcepto(List<Concepto> listConcepto) {
		this.listConcepto = listConcepto;
	}

	public Concepto getConceptoSelected() {
		return conceptoSelected;
	}

	public void setConceptoSelected(Concepto conceptoSelected) {
		this.conceptoSelected = conceptoSelected;
	}

	public Cobro getCobro() {
		return cobro;
	}

	public void setCobro(Cobro cobro) {
		this.cobro = cobro;
	}

	public CobroService getServiceCobro() {
		return serviceCobro;
	}

	public void setServiceCobro(CobroService serviceCobro) {
		this.serviceCobro = serviceCobro;
	}

	public List<Modopago> getListModoPago() {
		return listModoPago;
	}

	public void setListModoPago(List<Modopago> listModoPago) {
		this.listModoPago = listModoPago;
	}

	public Modopago getModoPagoSelected() {
		return modoPagoSelected;
	}

	public void setModoPagoSelected(Modopago modoPagoSelected) {
		this.modoPagoSelected = modoPagoSelected;
	}

	public ModoPagoService getServiceModoPago() {
		return serviceModoPago;
	}

	public void setServiceModoPago(ModoPagoService serviceModoPago) {
		this.serviceModoPago = serviceModoPago;
	}
}
